#! /usr/local/bin/gforth-fast
require string.fs
require http1.1.4th
require html4.0.4th
\  s" hello this is useless"
head.http
html.
head.
    s" text/html;charset=utf-8" meta.http-equiv
    title. ." ForthCGI项目:CGI测试页面" .title

.head
body.

h1. ." CGI测试页面" .h1 hr
\ h5. ." 建设中……" .h5
h3. ." CGI环境变量" .h3
: type_cgi_env 2dup td. type .td getenv td. type .td td. type .td tr ;
table. tr 
: tbh td. ." 变量名称" .td ." <td width='150'>" ." 变量内容" .td td. ." 变量和参数说明" .td tr ;
s" 请求类型，如'GET'或'POST'" s" REQUEST_METHOD" type_cgi_env
s" 被发送数据的类型" s" CONTENT_TYPE" type_cgi_env
s" 客户端向标准输入设备发送的数据长度，单位为字节" s" CONTENT_LENGTH" type_cgi_env 
s" 查询参数，如'id=10010&sn=liigo'" s" QUERY_STRING" type_cgi_env 
s" CGI脚本程序名称" s" SCRIPT_NAME" type_cgi_env 
s" CGI脚本程序附加路径" s" PATH_INFO" type_cgi_env
s" PATH_INFO对应的绝对路径" s" PATH_TRANSLATED" type_cgi_env
s" 发送此次请求的主机IP" s" REMOTE_ADDR" type_cgi_env 
s" 发送此次请求的主机名" s" REMOTE_HOST" type_cgi_env 
s" 已被验证合法的用户名" s" REMOTE_USER" type_cgi_env 
s" WEB服务器的登录用户名" s" REMOTE_IDENT" type_cgi_env 
s" 验证类型" s" AUTH_TYPE" type_cgi_env 
s" 服务器遵守的CGI版本，如：CGI/1.1" s" GATEWAY_INTERFACE" type_cgi_env 
s" 服务器主机名、域名或IP" s" SERVER_NAME" type_cgi_env 
s" 服务器端口号" s" SERVER_PORT" type_cgi_env 
s" 服务器协议，如：HTTP/1.1" s" SERVER_PROTOCOL" type_cgi_env 
s" 文档根目录" s" DOCUMENT_ROOT" type_cgi_env 
s" 服务器软件的描述文本" s" SERVER_SOFTWARE" type_cgi_env 
s" 客户端可以接收的MIME类型，以逗号分隔" s" HTTP_ACCEPT" type_cgi_env 
s" 发送此次请求的web浏览器" s" HTTP_USER_AGENT" type_cgi_env 
s" 调用此脚本程序的文档" s" HTTP_REFERER" type_cgi_env 
s" 获取COOKIE键值对，多项之间以分号分隔如：key1=value1;key2=value2" s" HTTP_COOKIE" type_cgi_env 
                        
.table
br 
h3. ." FastCGI扩展的环境变量" .h3

\ FastCGI环境变量名称		说明
table.
tbh
s" 当前FastCGI程序担当的角色，如：RESPONDER,AUTHORIZER,FILTER" s" FCGI_ROLE" type_cgi_env 
s" 服务器发送的数据长度，仅当FCGI_ROLE为：FILTER时有效" s" FCGI_DATA_LENGTH" type_cgi_env 
s" 输入文件的最后修改时间，其值为自1970年1月1日零时零分零秒至今的秒数，仅当FCGI_ROLE为FILTER时有效" s" FILE_LAST_MOD" type_cgi_env 
.table
h3. s" 主机操作系统环境变量" s" hostenv" a.label .h3
table.
s" " s" MACHTYPE" type_cgi_env
s" " s" USER" type_cgi_env
s" " s" SSH_CLIENT" type_cgi_env
s" " s" MAIL" type_cgi_env
s" " s" SHLVL" type_cgi_env
s" " s" VENDOR" type_cgi_env
s" " s" HOME" type_cgi_env
s" " s" SSH_TTY" type_cgi_env
s" " s" PAGER" type_cgi_env
s" " s" ENV" type_cgi_env
s" " s" GROUP" type_cgi_env
s" " s" LOGNAME" type_cgi_env
s" " s" TERM" type_cgi_env
s" " s" BLOCKSIZE" type_cgi_env
s" " s" PATH" type_cgi_env
s" " s" RC_PID" type_cgi_env
s" " s" REMOTEHOST" type_cgi_env
s" " s" HOST" type_cgi_env
s" " s" SHELL" type_cgi_env
s" " s" OSTYPE" type_cgi_env
s" " s" PWD" type_cgi_env
s" " s" LC_ALL" type_cgi_env
s" " s" SSH_CONNECTION" type_cgi_env
s" " s" FTP_PASSIVE_MODE" type_cgi_env
s" " s" HOSTTYPE" type_cgi_env
s" " s" EDITOR" type_cgi_env
s" " s" PHP_FCGI_CHILDREN" type_cgi_env
.table
hr s" 回到主页" s" index.4th" a.go
\ hr a.close
.body
.html
bye
